home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KDChartPropertySet.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  35.7 KB  |  986 lines

  1. /* -*- Mode: C++ -*-
  2.    KDChart - a multi-platform charting engine
  3.    */
  4.  
  5. /****************************************************************************
  6.  ** Copyright (C) 2001-2003 Klar├ñlvdalens Datakonsult AB.  All rights reserved.
  7.  **
  8.  ** This file is part of the KDChart library.
  9.  **
  10.  ** This file may be distributed and/or modified under the terms of the
  11.  ** GNU General Public License version 2 as published by the Free Software
  12.  ** Foundation and appearing in the file LICENSE.GPL included in the
  13.  ** packaging of this file.
  14.  **
  15.  ** Licensees holding valid commercial KDChart licenses may use this file in
  16.  ** accordance with the KDChart Commercial License Agreement provided with
  17.  ** the Software.
  18.  **
  19.  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20.  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21.  **
  22.  ** See http://www.klaralvdalens-datakonsult.se/?page=products for
  23.  **   information about KDChart Commercial License Agreements.
  24.  **
  25.  ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
  26.  ** licensing are not clear to you.
  27.  **
  28.  **********************************************************************/
  29. #ifndef __KDCHARTPROPERTYSET__
  30. #define __KDCHARTPROPERTYSET__
  31.  
  32.  
  33. #include <KDChartEnums.h>
  34. #include <kdchart_export.h>
  35. #include <qdom.h>
  36. #include <qcolor.h>
  37. #include <qbrush.h>
  38.  
  39. /**
  40.   \file KDChartPropertySet.h
  41.  
  42.   \brief Property settings of a single KDChart data cell.
  43.   */
  44.  
  45. /**
  46.   \class KDChartPropertySet KDChartPropertySet.h
  47.   \brief Property settings of a single KDChart data cell.
  48.  
  49.   \note The property settings feature currently is supported by
  50.   normal (== not 3-dimensional!) Line Charts only. Future releases
  51.   of KDChart will offer a rich set of options to use cell-specific
  52.   properties for other chart types as well...
  53.  
  54.   The KDChartPropertySet class stores several settings to be
  55.   used by the painter classes to decide how to visualize the
  56.   respective data cell.
  57.   Each of the settings may be specified either by giving a
  58.   value for it or by using the ID of another KDChartPropertySet
  59. instance: If the later the value of that instance is used
  60. instead of the value that is stored locally.
  61.  
  62. \sa KDChartData::setPropertySet
  63. \sa KDCHART_PROPSET_NORMAL_DATA, KDCHART_PROPSET_TRANSPARENT_DATA
  64. \sa KDChartParams::registerProperties
  65. */
  66. class KDCHART_EXPORT KDChartPropertySet :public QObject
  67. {
  68.     Q_OBJECT
  69.     Q_ENUMS( SpecialDataPropertyID )
  70.  
  71.     // Required by QSA
  72.     Q_ENUMS( PenStyle )
  73.  
  74.     friend class KDChartParams;
  75.  
  76.     public:
  77.     /**
  78.       Special property IDs.
  79.  
  80.       \li \c UndefinedID (the default value)
  81.       used to indicate that <b>no</b> ID was set for
  82.       members \c mIdLineWidth, \c mIdLineColor,
  83.       \c mIdLineStyle, \c mIdShowMarker and the like...
  84.  
  85.       \li \c OwnID used for referencing a property set's *own* ID.
  86.  
  87.       \sa KDChartPropertySet
  88.       */
  89.     enum SpecialDataPropertyID {
  90.         UndefinedID = -2,
  91.         OwnID = -1
  92.     };
  93.  
  94.     /**
  95.       default constructor setting all values to undefined
  96.       and name to empty string
  97.       */
  98.     KDChartPropertySet() :
  99.         mOwnID( UndefinedID )
  100.     { fullReset(""); }
  101.  
  102.  
  103.     /**
  104.       Constructor setting all Property Set IDs to the same ID value.
  105.  
  106.       This constructor may be used to initialize a property set
  107.       and let it have all property IDs set to a specific value,
  108.       e.g. you might pass KDCHART_PROPSET_NORMAL_DATA
  109.       as ID to make the default property set the parent of all
  110.       values.
  111.  
  112.       \param name (may be empty) a name describing this property set.
  113.       \param idParent the ID of the parent property set. Skip this paramter
  114.       to define a property set without specifying a parent.
  115.       */
  116.     KDChartPropertySet( const QString& name, int idParent=KDChartPropertySet::UndefinedID ) :
  117.         mOwnID( UndefinedID )
  118.     { fullReset( name, idParent ); }
  119.  
  120.  
  121.     /**
  122.       Copy the settings stored by property set \c source into this property set.
  123.  
  124.       \note Use this method instead of using the assignment operator.
  125.  
  126.       \sa clone, quickReset, fullReset
  127.       */
  128.     void deepCopy( const KDChartPropertySet* source );
  129.  
  130.  
  131.     /**
  132.       Create a new property set on the heap, copy the settings stored by
  133.       this property set into the newly created property set and return
  134.       the pointer to the new property set.
  135.  
  136.       \note Use this method instead of using the copy constructor.
  137.  
  138.       \sa deepCopy, quickReset, fullReset
  139.       */
  140.     const KDChartPropertySet* clone() const;
  141.  
  142.  
  143.     /**
  144.       Set the name,
  145.       set all of the ID settings to idParent,
  146.       but do NOT change the value settings,
  147.       and do NOT modify mOwnID.
  148.  
  149.       \note Use this to quickly reset the ID settings: in most cases this should
  150.       be sufficient for resetting the property set.
  151.  
  152.       \sa clone, fullReset
  153.       */
  154.     void quickReset( const QString& name, int idParent=KDChartPropertySet::UndefinedID );
  155.  
  156.  
  157.     /**
  158.       Set the name,
  159.       set all of the ID settings to idParent,
  160.       set all of the value settings back to their default value,
  161.       but do NOT modify mOwnID.
  162.  
  163.       \note Use this to entirely reset both the ID values and the value settings: one of
  164.       the very few reasons why you might want to do that might be your saving this property set
  165.       into a data stream. In most other cases just calling quickReset should be sufficient.
  166.  
  167.       \sa clone, quickReset
  168.       */
  169.     void fullReset( const QString& name, int idParent=KDChartPropertySet::UndefinedID );
  170.  
  171.  
  172.     /**
  173.       Save this property set's settings in a stream,
  174.       this stores the own property set ID as well.
  175.  
  176.       \sa loadXML
  177.       */
  178.     QDomElement saveXML(QDomDocument& doc) const;
  179.  
  180.  
  181.     /**
  182.       Retrieves a property set and stores it in parameter set.
  183.  
  184.       \note Since the property set's internal <b>ID</b> is also read
  185.       make sure to call KDChartParams::setProperties( set.id(), set )
  186.       after calling \c load() if you want to use the loaded
  187.       property set in the context of KDChartParam settings.
  188.  
  189.       \returns TRUE if the property set could be read.
  190.  
  191.       \sa id, saveXLM
  192.       */
  193.     static bool loadXML( const QDomElement& element, KDChartPropertySet& set );
  194.  
  195. public slots:
  196.     /**
  197.       Returns the name of this property set.
  198.       */
  199.     int id() const { return mOwnID; }
  200.  
  201.     /**
  202.       Change the descriptive name of this property set.
  203.       */
  204.     void setName( const QString& name )
  205.     {
  206.         mName = name;
  207.     }
  208.  
  209.     /**
  210.       Returns the name of this property set.
  211.       */
  212.     QString name() const { return mName; }
  213.  
  214.  
  215.  
  216.     /**
  217.       Specify the ID of the property set specifying a boolean flag indicating
  218.       whether this cell's bar is to be painted
  219.       <b>or</b> specifying this flag directly.
  220.  
  221.       \note This function should be used for Bar Charts only, otherwise
  222.       the settings specified here will be ignored.
  223.  
  224.       \param idShowBar ID of the property set specifying the flag
  225.       indicating whether this cell's bar is to be painted.
  226.       Use special value KDChartPropertySet::UndefinedID
  227.       to specify neither another property set's ID
  228.       nor an own value for this flag.
  229.       Use special value KDChartPropertySet::OwnID
  230.       if you do NOT want to inherit another property set's
  231.       settings but want to specify the flag by using
  232.       the following parameter.
  233.       \param showBar  Flag indicating whether this cell's bar is to be painted.
  234.       This parameter is stored but ignored if the previous parameter
  235.       is not set to KDChartPropertySet::OwnID.
  236.  
  237.       \sa hasOwnShowBar
  238.       \sa setBarColor
  239.       \sa hasOwnBarColor
  240.       */
  241.     void setShowBar( int idShowBar, bool showBar )
  242.     {
  243.         mIdShowBar = idShowBar;
  244.         mShowBar =   showBar;
  245.     }
  246.  
  247.     /**
  248.       Returns whether this property set is specifying it's own flag indicating
  249.       whether this cell's bar is to be painted.
  250.  
  251.       \note This function should be used for Bar Charts only, otherwise
  252.       the settings specified here will be ignored.
  253.  
  254.       \returns TRUE if this property set is specifying it's own showBar flag,
  255.       FALSE if the settings of another property set are to be used instead.
  256.  
  257.       \note The return value will also be FALSE if the 'default' properties
  258.       are to be used: in this case idShowBar will be KDChartParams::NormalData
  259.  
  260.       \param idShowBar to be ignored if return value is TRUE.
  261.       If idShowBar is KDChartPropertySet::UndefinedID
  262.       then neither a property set ID
  263.       nor an own flag were specified (so no special
  264.       enabeling/disabeling of bars is associated to the
  265.       respective data cell), else idShowBar contains the
  266.       ID of another property set that is specifying the flag
  267.       to be used.
  268.       \param showBar  this parameter's value is not modified if return value is FALSE.
  269.       Parameter showBar contains the showBar flag
  270.       associated with the respective data cell.
  271.       If return value is FALSE the showBar
  272.       flag is not set (so the parameter keeps its previous value)
  273.       but this is to be overridden by the respective value
  274.       of another property set that is indicated
  275.       by the idShowBar parameter - unless this has the special
  276.       value KDChartPropertySet::UndefinedID as decribed above.
  277.  
  278.       \sa setShowBar
  279.       \sa setBarColor
  280.       \sa hasOwnBarColor
  281.       */
  282.     bool hasOwnShowBar( int& idShowBar, bool& showBar )
  283.     {
  284.         idShowBar = mIdShowBar;
  285.         if( OwnID == idShowBar ){
  286.             showBar = mShowBar;
  287.             return true;
  288.         }
  289.         return false;
  290.     }
  291.  
  292.     /**
  293.       Specify the ID of the property set specifying the bar color
  294.       to be used for this cell
  295.       <b>or</b> specify the bar color directly.
  296.  
  297.       \note This function should be used for Bar Charts only, otherwise
  298.       the settings specified here will be ignored.
  299.  
  300.       \param idBarColor ID of the property set specifying the bar color.
  301.       Use special value KDChartPropertySet::UndefinedID
  302.       to specify neither another property set's ID
  303.       nor an own value for the bar color.
  304.       Use special value KDChartPropertySet::OwnID
  305.       if you do NOT want to inherit another property set's
  306.       settings but want to specify the bar color by using
  307.       the following parameter.
  308.       \param barColor   The bar color to be used.
  309.       This parameter is stored but ignored if the previous parameter
  310.       is not set to KDChartPropertySet::OwnID.
  311.  
  312.       \sa hasOwnBarColor
  313.       */
  314.     void setBarColor( int idBarColor, const QColor& barColor )
  315.     {
  316.         mIdBarColor = idBarColor;
  317.         mBarColor = barColor;
  318.     }
  319.  
  320.     /**
  321.       Returns whether this property set is specifying it's own bar color settings.
  322.  
  323.       \note This function should be used for Bar Charts only, otherwise
  324.       the settings specified here will be ignored.
  325.  
  326.       \returns TRUE if this property set is specifying it's own bar color settings,
  327.       FALSE if the settings of another property set are to be used instead.
  328.  
  329.       \note The return value will also be FALSE if the 'default' properties
  330.       are to be used: in this case idBarColor will be KDChartParams::NormalData
  331.  
  332.       \param idBarColor to be ignored if return value is TRUE.
  333.       If idBarColor is KDChartPropertySet::UndefinedID
  334.       then neither a property set ID
  335.       nor an own bar color were specified (so no special
  336.       Bar color is associated to the respective data cell),
  337.       else idBarColor contains the ID of another property set
  338.       that is specifying the Bar color to be used.
  339.       \param barColor   this parameter's value is not modified if return value is FALSE.
  340.       Parameter barColor contains the bar color value
  341.       associated with the respective data cell.
  342.       If return value is FALSE the barColor
  343.       value is not set (so the parameter keeps its previous value)
  344.       but this is to be overridden by the respective value
  345.       of another property set that is indicated
  346.       by the idBarColor parameter - unless this has the special
  347.       value KDChartPropertySet::UndefinedID as decribed above.
  348.  
  349.       \sa setBarColor
  350.       */
  351.     bool hasOwnBarColor( int& idBarColor, QColor& barColor )
  352.     {
  353.         idBarColor = mIdBarColor;
  354.         if( OwnID == mIdBarColor ){
  355.             barColor = mBarColor;
  356.             return true;
  357.         }
  358.         return false;
  359.     }
  360.  
  361.  
  362.     /**
  363.       Specify the ID of the property set specifying the line width
  364.       to be used for drawing a line from this data point to the next one
  365.       <b>or</b> specify the line width directly.
  366.  
  367.       \note This function should be used for Line Charts only, otherwise
  368.       the settings specified here will be ignored.
  369.  
  370.       \param idLineWidth ID of the property set specifying the line width.
  371.       Use special value KDChartPropertySet::UndefinedID
  372.       to specify neither another property set's ID
  373.       nor an own value for the line width.
  374.       Use special value KDChartPropertySet::OwnID
  375.       if you do NOT want to inherit another property set's
  376.       settings but want to specify the line width by using
  377.       the following parameter.
  378.       \param lineWidth   The line width to be used.
  379.       This parameter is stored but ignored if the previous parameter
  380.       is not set to KDChartPropertySet::OwnID.
  381.  
  382.       \sa setLineWidth, setLineColor, setLineStyle, setShowMarker
  383.       \sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
  384.       */
  385.     void setLineWidth( int idLineWidth, int lineWidth )
  386.     {
  387.         mIdLineWidth = idLineWidth;
  388.         mLineWidth =   lineWidth;
  389.     }
  390.  
  391.     /**
  392.       Returns whether this property set is specifying it's own line width settings.
  393.  
  394.       \note This function should be used for Line Charts only.
  395.  
  396.       \returns TRUE if this property set is specifying it's own line width settings,
  397.       FALSE if the settings of another property set are to be used instead.
  398.  
  399.       \param idLineWidth to be ignored if return value is TRUE.
  400.       If idLineWidth is KDChartPropertySet::UndefinedID
  401.       then neither a property set ID
  402.       nor an own line width were specified (so no special
  403.       line width is associated to the respective data cell),
  404.       else idLineWidth contains the ID of another property set
  405.       that is specifying the line width to be used.
  406.       \param lineWidth   this parameter's value is not modified if return value is FALSE.
  407.       Parameter lineWidth contains the line width value
  408.       associated with the respective data cell.
  409.       If return value is FALSE the lineWidth
  410.       value is not set (so the parameter keeps its previous value)
  411.       but this is to be overridden by the respective value
  412.       of another property set that is indicated
  413.       by the idLineWidth parameter - unless this has the special
  414.       value KDChartPropertySet::UndefinedID as decribed above.
  415.  
  416.       \sa setLineWidth, setLineColor, setLineStyle, setShowMarker
  417.       \sa hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
  418.       */
  419.     bool hasOwnLineWidth( int& idLineWidth, int& lineWidth )
  420.     {
  421.         idLineWidth = mIdLineWidth;
  422.         if( OwnID == mIdLineWidth ){
  423.             lineWidth = mLineWidth;
  424.             return true;
  425.         }
  426.         return false;
  427.     }
  428.  
  429.     /**
  430.       Specify the ID of the property set specifying the line color
  431.       to be used for drawing a line from this data point to the next one
  432.       <b>or</b> specify the line color directly.
  433.  
  434.       \note This function should be used for Line Charts only, otherwise
  435.       the settings specified here will be ignored.
  436.  
  437.       \param idLineColor ID of the property set specifying the line color.
  438.       Use special value KDChartPropertySet::UndefinedID
  439.       to specify neither another property set's ID
  440.       nor an own value for the line color.
  441.       Use special value KDChartPropertySet::OwnID
  442.       if you do NOT want to inherit another property set's
  443.       settings but want to specify the line color by using
  444.       the following parameter.
  445.       \param lineColor   The line color to be used.
  446.       This parameter is stored but ignored if the previous parameter
  447.       is not set to KDChartPropertySet::OwnID.
  448.  
  449.       \sa setLineWidth, setLineStyle, setShowMarker
  450.       \sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
  451.       */
  452.     void setLineColor( int idLineColor, const QColor& lineColor )
  453.     {
  454.         mIdLineColor = idLineColor;
  455.         mLineColor = lineColor;
  456.     }
  457.  
  458.     /**
  459.       Returns whether this property set is specifying it's own line color settings.
  460.  
  461.       \note This function should be used for Line Charts only, otherwise
  462.       the settings specified here will be ignored.
  463.  
  464.       \returns TRUE if this property set is specifying it's own line color settings,
  465.       FALSE if the settings of another property set are to be used instead.
  466.  
  467.       \note The return value will also be FALSE if the 'default' properties
  468.       are to be used: in this case idLineColor will be KDChartParams::NormalData
  469.  
  470.       \param idLineColor to be ignored if return value is TRUE.
  471.       If idLineColor is KDChartPropertySet::UndefinedID
  472.       then neither a property set ID
  473.       nor an own line color were specified (so no special
  474.       line color is associated to the respective data cell),
  475.       else idLineColor contains the ID of another property set
  476.       that is specifying the line color to be used.
  477.       \param lineColor   this parameter's value is not modified if return value is FALSE.
  478.       Parameter lineColor contains the line color value
  479.       associated with the respective data cell.
  480.       If return value is FALSE the lineColor
  481.       value is not set (so the parameter keeps its previous value)
  482.       but this is to be overridden by the respective value
  483.       of another property set that is indicated
  484.       by the idLineColor parameter - unless this has the special
  485.       value KDChartPropertySet::UndefinedID as decribed above.
  486.  
  487.       \sa setLineWidth, setLineColor, setLineStyle, setShowMarker
  488.       \sa hasOwnLineWidth, hasOwnLineStyle, hasOwnShowMarker
  489.       */
  490.     bool hasOwnLineColor( int& idLineColor, QColor& lineColor )
  491.     {
  492.         idLineColor = mIdLineColor;
  493.         if( OwnID == mIdLineColor ){
  494.             lineColor = mLineColor;
  495.             return true;
  496.         }
  497.         return false;
  498.     }
  499.  
  500.     /**
  501.       Specify the ID of the property set specifying the line style
  502.       to be used for drawing a line from this data point to the next one
  503.       <b>or</b> specify the line width directly.
  504.  
  505.       \note This function should be used for Line Charts only, otherwise
  506.       the settings specified here will be ignored.
  507.  
  508.       \param idLineStyle ID of the property set specifying the line style.
  509.       Use special value KDChartPropertySet::UndefinedID
  510.       to specify neither another property set's ID
  511.       nor an own value for the line style.
  512.       Use special value KDChartPropertySet::OwnID
  513.       if you do NOT want to inherit another property set's
  514.       settings but want to specify the line style by using
  515.       the following parameter.
  516.       \param lineStyle   The line style to be used.
  517.       This parameter is stored but ignored if the previous parameter
  518.       is not set to KDChartPropertySet::OwnID.
  519.  
  520.       \sa setLineWidth, setLineColor, setShowMarker
  521.       \sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
  522.       */
  523.     void setLineStyle( int idLineStyle, const PenStyle& lineStyle )
  524.     {
  525.         mIdLineStyle = idLineStyle;
  526.         mLineStyle =   lineStyle;
  527.     }
  528.  
  529.     /**
  530.       Returns whether this property set is specifying it's own line style settings.
  531.  
  532.       \note This function should be used for Line Charts only, otherwise
  533.       the settings specified here will be ignored.
  534.  
  535.       \returns TRUE if this property set is specifying it's own line style settings,
  536.       FALSE if the settings of another property set are to be used instead.
  537.  
  538.       \note The return value will also be FALSE if the 'default' properties
  539.       are to be used: in this case idLineStyle will be KDChartParams::NormalData
  540.  
  541.       \param idLineStyle to be ignored if return value is TRUE.
  542.       If idLineStyle is KDChartPropertySet::UndefinedID
  543.       then neither a property set ID
  544.       nor an own line style were specified (so no special
  545.       line style is associated to the respective data cell),
  546.       else idLineStyle contains the ID of another property set
  547.       that is specifying the line style to be used.
  548.       \param lineStyle   this parameter's value is not modified if return value is FALSE.
  549.       Parameter lineStyle contains the line style value
  550.       associated with the respective data cell.
  551.       If return value is FALSE the lineStyle
  552.       value is not set (so the parameter keeps its previous value)
  553.       but this is to be overridden by the respective value
  554.       of another property set that is indicated
  555.       by the idLineStyle parameter - unless this has the special
  556.       value KDChartPropertySet::UndefinedID as decribed above.
  557.  
  558.       \sa setLineWidth, setLineColor, setLineStyle, setShowMarker
  559.       \sa hasOwnLineWidth, hasOwnLineColor, hasOwnShowMarker
  560.       */
  561.     bool hasOwnLineStyle( int& idLineStyle, PenStyle& lineStyle )
  562.     {
  563.         idLineStyle = mIdLineStyle;
  564.         if( OwnID == mIdLineStyle ){
  565.             lineStyle = mLineStyle;
  566.             return true;
  567.         }
  568.         return false;
  569.     }
  570.  
  571.  
  572.  
  573.     /**
  574.       Specify the ID of the property set specifying the area brush
  575.       to be used for this cell
  576.       <b>or</b> specify the area brush directly.
  577.  
  578.       \note This function should be used for Area Charts in <b>Normal</b> mode
  579.       only, otherwise the settings specified here will be ignored.
  580.  
  581.       \param idAreaBrush ID of the property set specifying the area brush.
  582.       Use special value KDChartPropertySet::UndefinedID
  583.       to specify neither another property set's ID
  584.       nor an own value for the area brush.
  585.       Use special value KDChartPropertySet::OwnID
  586.       if you do NOT want to inherit another property set's
  587.       settings but want to specify the area brush by using
  588.       the following parameter.
  589.       \param areaBrush   The area brush to be used.
  590.       This parameter is stored but ignored if the previous parameter
  591.       is not set to KDChartPropertySet::OwnID.
  592.  
  593.       \sa hasOwnAreaBrush
  594.       */
  595.     void setAreaBrush( int idAreaBrush, const QBrush& areaBrush )
  596.     {
  597.         mIdAreaBrush = idAreaBrush;
  598.         mAreaBrush = areaBrush;
  599.     }
  600.  
  601.     /**
  602.       Returns whether this property set is specifying it's own area brush settings.
  603.  
  604.       \note This function should be used for Area Charts in <b>Normal</b> mode
  605.       only, otherwise the settings specified here will be ignored.
  606.  
  607.       \returns TRUE if this property set is specifying it's own area brush settings,
  608.       FALSE if the settings of another property set are to be used instead.
  609.  
  610.       \note The return value will also be FALSE if the 'default' properties
  611.       are to be used: in this case idAreaBrush will be KDChartParams::NormalData
  612.  
  613.       \param idAreaBrush to be ignored if return value is TRUE.
  614.       If idAreaBrush is KDChartPropertySet::UndefinedID
  615.       then neither a property set ID
  616.       nor an own area brush were specified (so no special
  617.       area brush is associated to the respective data cell),
  618.       else idAreaBrush contains the ID of another property set
  619.       that is specifying the area brush to be used.
  620.       \param areaBrush   this parameter's value is not modified if return value is FALSE.
  621.       Parameter areaBrush contains the area brush value
  622.       associated with the respective data cell.
  623.       If return value is FALSE the areaBrush
  624.       value is not set (so the parameter keeps its previous value)
  625.       but this is to be overridden by the respective value
  626.       of another property set that is indicated
  627.       by the idAreaBrush parameter - unless this has the special
  628.       value KDChartPropertySet::UndefinedID as decribed above.
  629.  
  630.       \sa setAreaBrush
  631.       */
  632.     bool hasOwnAreaBrush( int& idAreaBrush, QBrush& areaBrush )
  633.     {
  634.         idAreaBrush = mIdAreaBrush;
  635.         if( OwnID == mIdAreaBrush ){
  636.             areaBrush = mAreaBrush;
  637.             return true;
  638.         }
  639.         return false;
  640.     }
  641.  
  642.  
  643.  
  644.  
  645.  
  646.     /**
  647.       Specify the ID of the property set specifying a boolean flag indicating
  648.       whether a Marker is to be displayed for this data value
  649.       <b>or</b> specifying this flag directly.
  650.  
  651.       \note This function should be used for Line Charts only, otherwise
  652.       the settings specified here will be ignored.
  653.  
  654.       \param idShowMarker ID of the property set specifying the flag
  655.       indicating whether a marker is to be shown.
  656.       Use special value KDChartPropertySet::UndefinedID
  657.       to specify neither another property set's ID
  658.       nor an own value for this flag.
  659.       Use special value KDChartPropertySet::OwnID
  660.       if you do NOT want to inherit another property set's
  661.       settings but want to specify the flag by using
  662.       the following parameter.
  663.       \param showMarker  Flag indicating whether a marker is to be shown.
  664.       This parameter is stored but ignored if the previous parameter
  665.       is not set to KDChartPropertySet::OwnID.
  666.  
  667.       \sa hasOwnShowMarker
  668.       \sa setMarkerAlign, setMarkerSize, setMarkerColor, setMarkerStyle
  669.       \sa setLineWidth, setLineColor, setLineStyle
  670.       */
  671.     void setShowMarker( int idShowMarker, bool showMarker )
  672.     {
  673.         mIdShowMarker = idShowMarker;
  674.         mShowMarker =   showMarker;
  675.     }
  676.  
  677.     /**
  678.       Returns whether this property set is specifying it's own flag indicating
  679.       whether a Marker is to be displayed.
  680.  
  681.       \note This function should be used for Line Charts only, otherwise
  682.       the settings specified here will be ignored.
  683.  
  684.       \returns TRUE if this property set is specifying it's own showMarker flag,
  685.       FALSE if the settings of another property set are to be used instead.
  686.  
  687.       \note The return value will also be FALSE if the 'default' properties
  688.       are to be used: in this case idShowMarker will be KDChartParams::NormalData
  689.  
  690.       \param idShowMarker to be ignored if return value is TRUE.
  691.       If idShowMarker is KDChartPropertySet::UndefinedID
  692.       then neither a property set ID
  693.       nor an own flag were specified (so no special
  694.       enabeling/disabeling of markers is associated to the
  695.       respective data cell), else idShowMarker contains the
  696.       ID of another property set that is specifying the flag
  697.       to be used.
  698.       \param showMarker  this parameter's value is not modified if return value is FALSE.
  699.       Parameter showMarker contains the showMarker flag
  700.       associated with the respective data cell.
  701.       If return value is FALSE the showMarker
  702.       flag is not set (so the parameter keeps its previous value)
  703.       but this is to be overridden by the respective value
  704.       of another property set that is indicated
  705.       by the idShowMarker parameter - unless this has the special
  706.       value KDChartPropertySet::UndefinedID as decribed above.
  707.  
  708.       \sa setShowMarker
  709.       \sa hasOwnMarkerAlign, hasOwnMarkerSize, hasOwnMarkerColor, hasOwnMarkerStyle
  710.       \sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle
  711.       */
  712.     bool hasOwnShowMarker( int& idShowMarker, bool& showMarker )
  713.     {
  714.         idShowMarker = mIdShowMarker;
  715.         if( OwnID == idShowMarker ){
  716.             showMarker = mShowMarker;
  717.             return true;
  718.         }
  719.         return false;
  720.     }
  721.  
  722.     /**
  723.       Specify the ID of the property set specifying the alignment of the
  724.       Marker to be displayed for this data value
  725.       <b>or</b> specifying this flag directly.
  726.  
  727.       \note This function should be used for Line Charts only, otherwise
  728.       the settings specified here will be ignored.
  729.  
  730.       \param idMarkerAlign ID of the property set specifying the alignment
  731.       of the Marker to be shown.
  732.       Use special value KDChartPropertySet::UndefinedID
  733.       to specify neither another property set's ID
  734.       nor an own value for this flag.
  735.       Use special value KDChartPropertySet::OwnID
  736.       if you do NOT want to inherit another property set's
  737.       settings but want to specify the flag by using
  738.       the following parameter.
  739.       \param markerAlign  The alignment of the marker to be shown.
  740.       This parameter is stored but ignored if the previous parameter
  741.       is not set to KDChartPropertySet::OwnID.
  742.  
  743.       \sa hasOwnShowMarker
  744.       \sa setMarkerAlign, setMarkerSize, setMarkerColor, setMarkerStyle
  745.       \sa setLineWidth, setLineColor, setLineStyle
  746.       */
  747.     void setMarkerAlign( int idMarkerAlign, uint markerAlign )
  748.     {
  749.         mIdMarkerAlign = idMarkerAlign;
  750.         mMarkerAlign =   markerAlign;
  751.     }
  752.     bool hasOwnMarkerAlign( int& idMarkerAlign, uint& markerAlign )
  753.     {
  754.         idMarkerAlign = mIdMarkerAlign;
  755.         if( OwnID == idMarkerAlign ){
  756.             markerAlign = mMarkerAlign;
  757.             return true;
  758.         }
  759.         return false;
  760.     }
  761.     void setMarkerSize( int idMarkerSize, const QSize& markerSize )
  762.     {
  763.         mIdMarkerSize = idMarkerSize;
  764.         mMarkerSize =   markerSize;
  765.     }
  766.     bool hasOwnMarkerSize( int& idMarkerSize, QSize& markerSize )
  767.     {
  768.         idMarkerSize = mIdMarkerSize;
  769.         if( OwnID == idMarkerSize ){
  770.             markerSize = mMarkerSize;
  771.             return true;
  772.         }
  773.         return false;
  774.     }
  775.     void setMarkerColor( int idMarkerColor, const QColor& markerColor )
  776.     {
  777.         mIdMarkerColor = idMarkerColor;
  778.         mMarkerColor =   markerColor;
  779.     }
  780.     bool hasOwnMarkerColor( int& idMarkerColor, QColor& markerColor )
  781.     {
  782.         idMarkerColor = mIdMarkerColor;
  783.         if( OwnID == idMarkerColor ){
  784.             markerColor = mMarkerColor;
  785.             return true;
  786.         }
  787.         return false;
  788.     }
  789.     void setMarkerStyle( int idMarkerStyle, int markerStyle )
  790.     {
  791.         mIdMarkerStyle = idMarkerStyle;
  792.         mMarkerStyle =   markerStyle;
  793.     }
  794.     bool hasOwnMarkerStyle( int& idMarkerStyle, int& markerStyle )
  795.     {
  796.         idMarkerStyle = mIdMarkerStyle;
  797.         if( OwnID == idMarkerStyle ){
  798.             markerStyle = mMarkerStyle;
  799.             return true;
  800.         }
  801.         return false;
  802.     }
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.     void setExtraLinesAlign( int idExtraLinesAlign, uint extraLinesAlign )
  810.     {
  811.         mIdExtraLinesAlign = idExtraLinesAlign;
  812.         mExtraLinesAlign =   extraLinesAlign;
  813.     }
  814.     bool hasOwnExtraLinesAlign( int& idExtraLinesAlign, uint& extraLinesAlign )
  815.     {
  816.         idExtraLinesAlign = mIdExtraLinesAlign;
  817.         if( OwnID == idExtraLinesAlign ){
  818.             extraLinesAlign = mExtraLinesAlign;
  819.             return true;
  820.         }
  821.         return false;
  822.     }
  823.     void setExtraLinesInFront( int idExtraLinesInFront, bool extraLinesInFront )
  824.     {
  825.         mIdExtraLinesInFront = idExtraLinesInFront;
  826.         mExtraLinesInFront   = extraLinesInFront;
  827.     }
  828.     bool hasOwnExtraLinesInFront( int& idExtraLinesInFront, bool& extraLinesInFront )
  829.     {
  830.         idExtraLinesInFront = mIdExtraLinesInFront;
  831.         if( OwnID == idExtraLinesInFront ){
  832.             extraLinesInFront = mExtraLinesInFront;
  833.             return true;
  834.         }
  835.         return false;
  836.     }
  837.     void setExtraLinesLength( int idExtraLinesLength, int extraLinesLength )
  838.     {
  839.         mIdExtraLinesLength = idExtraLinesLength;
  840.         mExtraLinesLength =   extraLinesLength;
  841.     }
  842.     bool hasOwnExtraLinesLength( int& idExtraLinesLength, int& extraLinesLength )
  843.     {
  844.         idExtraLinesLength = mIdExtraLinesLength;
  845.         if( OwnID == idExtraLinesLength ){
  846.             extraLinesLength = mExtraLinesLength;
  847.             return true;
  848.         }
  849.         return false;
  850.     }
  851.     void setExtraLinesWidth( int idExtraLinesWidth, int extraLinesWidth )
  852.     {
  853.         mIdExtraLinesWidth = idExtraLinesWidth;
  854.         mExtraLinesWidth =   extraLinesWidth;
  855.     }
  856.     bool hasOwnExtraLinesWidth( int& idExtraLinesWidth, int& extraLinesWidth )
  857.     {
  858.         idExtraLinesWidth = mIdExtraLinesWidth;
  859.         if( OwnID == idExtraLinesWidth ){
  860.             extraLinesWidth = mExtraLinesWidth;
  861.             return true;
  862.         }
  863.         return false;
  864.     }
  865.     void setExtraLinesColor( int idExtraLinesColor, const QColor& extraLinesColor )
  866.     {
  867.         mIdExtraLinesColor = idExtraLinesColor;
  868.         mExtraLinesColor =   extraLinesColor;
  869.     }
  870.     bool hasOwnExtraLinesColor( int& idExtraLinesColor, QColor& extraLinesColor )
  871.     {
  872.         idExtraLinesColor = mIdExtraLinesColor;
  873.         if( OwnID == idExtraLinesColor ){
  874.             extraLinesColor = mExtraLinesColor;
  875.             return true;
  876.         }
  877.         return false;
  878.     }
  879.     void setExtraLinesStyle( int idExtraLinesStyle, const PenStyle extraLinesStyle )
  880.     {
  881.         mIdExtraLinesStyle = idExtraLinesStyle;
  882.         mExtraLinesStyle =   extraLinesStyle;
  883.     }
  884.     bool hasOwnExtraLinesStyle( int& idExtraLinesStyle, PenStyle& extraLinesStyle )
  885.     {
  886.         idExtraLinesStyle = mIdExtraLinesStyle;
  887.         if( OwnID == idExtraLinesStyle ){
  888.             extraLinesStyle = mExtraLinesStyle;
  889.             return true;
  890.         }
  891.         return false;
  892.     }
  893.  
  894.     void setExtraMarkersAlign( int idExtraMarkersAlign, uint extraMarkersAlign )
  895.     {
  896.         mIdExtraMarkersAlign = idExtraMarkersAlign;
  897.         mExtraMarkersAlign =   extraMarkersAlign;
  898.     }
  899.     bool hasOwnExtraMarkersAlign( int& idExtraMarkersAlign, uint& extraMarkersAlign )
  900.     {
  901.         idExtraMarkersAlign = mIdExtraMarkersAlign;
  902.         if( OwnID == idExtraMarkersAlign ){
  903.             extraMarkersAlign = mExtraMarkersAlign;
  904.             return true;
  905.         }
  906.         return false;
  907.     }
  908.     void setExtraMarkersSize( int idExtraMarkersSize, const QSize& extraMarkersSize )
  909.     {
  910.         mIdExtraMarkersSize = idExtraMarkersSize;
  911.         mExtraMarkersSize =   extraMarkersSize;
  912.     }
  913.     bool hasOwnExtraMarkersSize( int& idExtraMarkersSize, QSize& extraMarkersSize )
  914.     {
  915.         idExtraMarkersSize = mIdExtraMarkersSize;
  916.         if( OwnID == idExtraMarkersSize ){
  917.             extraMarkersSize = mExtraMarkersSize;
  918.             return true;
  919.         }
  920.         return false;
  921.     }
  922.     void setExtraMarkersColor( int idExtraMarkersColor, const QColor& extraMarkersColor )
  923.     {
  924.         mIdExtraMarkersColor = idExtraMarkersColor;
  925.         mExtraMarkersColor =   extraMarkersColor;
  926.     }
  927.     bool hasOwnExtraMarkersColor( int& idExtraMarkersColor, QColor& extraMarkersColor )
  928.     {
  929.         idExtraMarkersColor = mIdExtraMarkersColor;
  930.         if( OwnID == idExtraMarkersColor ){
  931.             extraMarkersColor = mExtraMarkersColor;
  932.             return true;
  933.         }
  934.         return false;
  935.     }
  936.     void setExtraMarkersStyle( int idExtraMarkersStyle, int extraMarkersStyle )
  937.     {
  938.         mIdExtraMarkersStyle = idExtraMarkersStyle;
  939.         mExtraMarkersStyle =   extraMarkersStyle;
  940.     }
  941.     bool hasOwnExtraMarkersStyle( int& idExtraMarkersStyle, int& extraMarkersStyle )
  942.     {
  943.         idExtraMarkersStyle = mIdExtraMarkersStyle;
  944.         if( OwnID == idExtraMarkersStyle ){
  945.             extraMarkersStyle = mExtraMarkersStyle;
  946.             return true;
  947.         }
  948.         return false;
  949.     }
  950.  
  951. protected:
  952.     // the following member only to be set internally by KDChartParams::registerProperties
  953.     // and by KDChartParams::setProperties
  954.     int mOwnID;
  955.  
  956. private:
  957.     KDChartPropertySet( const KDChartPropertySet& ) : QObject(0) {}
  958.  
  959.     QString mName;
  960.     // IDs:                     values used if ID == OwnID:
  961.     int mIdLineWidth;         int          mLineWidth;
  962.     int mIdLineColor;         QColor       mLineColor;
  963.     int mIdLineStyle;         Qt::PenStyle mLineStyle;
  964.     int mIdShowMarker;        bool         mShowMarker;
  965.     int mIdMarkerSize;        QSize        mMarkerSize;
  966.     int mIdMarkerColor;       QColor       mMarkerColor;
  967.     int mIdMarkerStyle;       int          mMarkerStyle;
  968.     int mIdMarkerAlign;       uint         mMarkerAlign;
  969.     int mIdExtraLinesAlign;   uint         mExtraLinesAlign;
  970.     int mIdExtraLinesInFront; bool         mExtraLinesInFront;
  971.     int mIdExtraLinesLength;  int          mExtraLinesLength;
  972.     int mIdExtraLinesWidth;   int          mExtraLinesWidth;
  973.     int mIdExtraLinesColor;   QColor       mExtraLinesColor;
  974.     int mIdExtraLinesStyle;   Qt::PenStyle mExtraLinesStyle;
  975.     int mIdExtraMarkersAlign; uint         mExtraMarkersAlign;
  976.     int mIdExtraMarkersSize;  QSize        mExtraMarkersSize;
  977.     int mIdExtraMarkersColor; QColor       mExtraMarkersColor;
  978.     int mIdExtraMarkersStyle; int          mExtraMarkersStyle;
  979.     int mIdShowBar;           bool         mShowBar;
  980.     int mIdBarColor;          QColor       mBarColor;
  981.     int mIdAreaBrush;         QBrush       mAreaBrush;
  982.     void fillValueMembersWithDummyValues();
  983. };
  984.  
  985. #endif
  986.